package com.ciccwm.core.validation.annotation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.ciccwm.core.validation.validator.EmailValidator;

/**
 * 邮箱验证注解.
 *
 * @author ciccwm
 */
@Documented
@Constraint(validatedBy = EmailValidator.class)
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Email {
    /**
     * 错误消息.
     *
     * @return 错误消息
     */
    String message() default "邮箱格式不正确";

    /**
     * 分组.
     *
     * @return 分组类数组
     */
    Class<?>[] groups() default {};

    /**
     * 负载.
     *
     * @return 负载类数组
     */
    Class<? extends Payload>[] payload() default {};
} 
